package com.lesent.hive;

import org.apache.hadoop.hive.ql.exec.UDF;
import org.apache.hadoop.io.Text;

/**
 * @author shengtao
 * @Description: hive函数
 * @date 2019/01/04 17:25
 */
public class ToLowerCase extends UDF{

    public Text evaluate(Text str){
        if(str == null) return null;
        if(str != null && str.toString().length() <= 0) return null;

        return new Text(str.toString().toLowerCase());
    }


    public static void main(String[] args) {
        System.out.println(new ToLowerCase().evaluate(new Text(args[0])));
    }
}
